import axios from "@/common/axios";
import { API_URL } from "@/common/constants";

export const queryCompanyList = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/queryCompanyList", json);
  return data;
};

export const queryCompanyInfo = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/queryCompanyInfo", json);
  return data;
};

export const updateCompany = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/updateCompany", json);
  return data;
};
export const resetPassword = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/resetPassword", json);
  return data;
};

export const addCompany = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/addCompany", json);
  return data;
};


export const delCompany = async (json) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/delCompany", json);
  return data;
};


export const importExcel = async (formData) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/importExcel", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}

export const uploadFile = async (formData) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/uploadFile", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}

export const uploadLogo = async (formData) => {
  let { data } = await axios.post(API_URL + "cCompanyApi/uploadLogo", formData, {
    headers: {
      'Content-Type': 'multipart/form-data;charset=utf-8'
    }
  });
  return data;

}


